 
 #include <iostream>
 
class Base1
{
public:
    Base1(int a):a(a){std::cout<<"Base1\n";}
    void show()
    {
        std::cout<<"a."<<a<<std::endl;
    }
    
protected:
    int a;
};

class Base2
{
public:
    Base2(int b):b(b){std::cout<<"Base2\n";}
    void add()
    {
        b++;
    }
    void show()
    {
        std::cout<<"b."<<b<<std::endl;
    }
protected:
    int b;
};

class Derived:public Base2
{
public:
    Derived(int a,int b):b1(a),Base2(b){}

    
    void show()
    {
        b1.show();
        Base2::show();
    }
private:
    Base1 b1;
    
};

 int main ()
 {
    Derived d(1,2);
    d.add();
    d.show();
    return 0;
 }